﻿using EShopV20.Areas.Adm.ActionFilters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace EShopV20.Controllers
{
    public class HomeController : Controller
    {
        EShopV20DbContext db = new EShopV20DbContext();

        [MyFilter]
        public ActionResult Index()
        {
            return View();
        }

        [MyFilter]
        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        [MyFilter]
        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult CategoryMenu()
        {
            var model = db.Categories;
            return PartialView("_Category", model);
        }

        public ActionResult SupplierMenu()
        {
            var model = db.Suppliers;
            return PartialView("_Supplier", model);
        }
    }
}